<?php

class Model{
	/**
	 *
	 * @var IDatabase
	 */
	var $db;
	/**
	 * 
	 *
	 * @var string
	 */
	var $table;
	
	static $intance = array();
	
	public function __construct(){
		$this->db = DB::getInstance();
	}
	
	public static function factory($class){
		if(!key_exists($class, self::$intance)){
			self::$intance[$class] = new $class();
		}
		return self::$intance[$class];
	}
}